package cn.tedu.fy.pethome.controller;


import cn.tedu.fy.pethome.pojo.dto.AdminSuppliesAddNewDTO;
import cn.tedu.fy.pethome.service.IAdminSuppliesService;
import cn.tedu.fy.pethome.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/admins-supplies")
@Api(tags = "管理员宠物用品")
public class AdminSuppliesController {
    @Autowired
    IAdminSuppliesService adminSuppliesService;

    @PostMapping("/add")
    @ApiOperation("添加宠物用品")
    @ApiOperationSupport(order = 100)
    public JsonResult addNew(@RequestBody AdminSuppliesAddNewDTO adminSuppliesAddNewDTO) {
        log.debug("接受到添加宠物用品的请求,参数为：{}",adminSuppliesAddNewDTO);
        adminSuppliesService.insert(adminSuppliesAddNewDTO);
        return JsonResult.ok();
    }
}
